package com.services;

import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

@Service
@ConditionalOnExpression("${com.watcher.enabled}") //INSTANTIATE ONLY IF ENABLED
public class WatcherService {

  @Scheduled(fixedDelayString = "${com.watcher.interval}")
  private synchronized void run() {
    //DO SOMETHING AT EACH INTERVAL
  }

}
